Telegram Group & Telegram Channel
🧠 Python-хитрая задача + решение

🖍️ Условие:
У тебя есть список логов (user, login/logout).
Найди тех, кто зашел, но не вышел.

📜 Пример:

logs = [
("alice", "login"),
("bob", "login"),
("alice", "logout"),
("dave", "login"),
("bob", "logout"),
("carol", "login"),
("dave", "logout")
]


________
💻 Решение:

from collections import defaultdict

def find_stuck_users(logs):
counter = defaultdict(int)
for user, action in logs:
if action == "login":
counter[user] += 1
elif action == "logout":
counter[user] -= 1
return sorted([user for user, count in counter.items() if count > 0])


🛠Ответ: "carol"

#Python #Challenge #DevPuzzle

@python_job_interview



tg-me.com/python_testit/1161
Create:
Last Update:

🧠 Python-хитрая задача + решение

🖍️ Условие:
У тебя есть список логов (user, login/logout).
Найди тех, кто зашел, но не вышел.

📜 Пример:


logs = [
("alice", "login"),
("bob", "login"),
("alice", "logout"),
("dave", "login"),
("bob", "logout"),
("carol", "login"),
("dave", "logout")
]


________
💻 Решение:

from collections import defaultdict

def find_stuck_users(logs):
counter = defaultdict(int)
for user, action in logs:
if action == "login":
counter[user] += 1
elif action == "logout":
counter[user] -= 1
return sorted([user for user, count in counter.items() if count > 0])


🛠Ответ: "carol"

#Python #Challenge #DevPuzzle

@python_job_interview

BY Python tests


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/python_testit/1161

View MORE
Open in Telegram


Python tests Telegram | DID YOU KNOW?

Date: |

That strategy is the acquisition of a value-priced company by a growth company. Using the growth company's higher-priced stock for the acquisition can produce outsized revenue and earnings growth. Even better is the use of cash, particularly in a growth period when financial aggressiveness is accepted and even positively viewed.he key public rationale behind this strategy is synergy - the 1+1=3 view. In many cases, synergy does occur and is valuable. However, in other cases, particularly as the strategy gains popularity, it doesn't. Joining two different organizations, workforces and cultures is a challenge. Simply putting two separate organizations together necessarily creates disruptions and conflicts that can undermine both operations.

How Does Bitcoin Mining Work?

Bitcoin mining is the process of adding new transactions to the Bitcoin blockchain. It’s a tough job. People who choose to mine Bitcoin use a process called proof of work, deploying computers in a race to solve mathematical puzzles that verify transactions.To entice miners to keep racing to solve the puzzles and support the overall system, the Bitcoin code rewards miners with new Bitcoins. “This is how new coins are created” and new transactions are added to the blockchain, says Okoro.

Python tests from ar


Telegram Python tests
FROM USA